import Vue from 'vue'
import VueRouter from 'vue-router'
import WeChat from '../components/weChat.vue'
import TongXunLu from '../components/tongxunlu.vue'
import Search from '../components/search.vue'
import Me from '../components/me.vue'
import index from '../views/index.vue'
 
Vue.use(VueRouter)
Vue.use(WeChat)


const routes = [
  {
    path:'/',
    redirect:'/index'
  },
  {path: '/',
  name: 'index',
  component: index,
  children:[
    {
    path: 'WeChat',
    name: 'WeChat',
    component: WeChat
    },
    {
      path: 'TongXunLu',
    name: 'TongXunLu',
    component: TongXunLu
    },{
      path: 'Search',
    name: 'Search',
    component: Search
    },{
      path: 'Me',
    name: 'Me',
    component: Me
    }
  ]
    
  },
  // {
  //   path: '/',
  //   name: 'WeChat',
  //   component: WeChat
  // },
  // {
  //   path: '/TongXunLu',
  //   name: 'TongXunLu',
  //   component: TongXunLu
  // },
  // {
  //   path: '/Search',
  //   name: 'Search',
  //   component: Search
  // },
  // {
  //   path: '/Me',
  //   name: 'Me',
  //   component: Me
  // }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
  routes
})

export default router
